package com.sanben.common.enums;

/**
 * @author: cyh
 * @description: 业务操作类型
 * @date: 2020/8/5 10:57
 */
public enum SmsTemplate {
    SYS_ERROR(234820, "【找车邦】您的手机注册验证码是：%s，如非本人操作，请忽略本信息！");
    private Integer code;
    private String message;

    SmsTemplate(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String getByMessage(Integer code) {
        for (SmsTemplate smsTemplate : SmsTemplate.values()) {
            if (smsTemplate.getCode().equals(code)) {
                return smsTemplate.getMessage();
            }
        }
        return null;
    }
}
